<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%
    String path = request.getContextPath();
    String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
 %>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>图片回显</title>
</head>
<body>
	<form action="PictureServerOrderIETwo" method="post"
		enctype="multipart/form-data">
		图片以及文件上传：<input type="file" name="fileupload" /> <input type="submit"
			value="submit" />
	</form>

	<hr />
	<p>ajax 接受图片数据，虽然还是采用表单，但是不会刷新页面</p>
	<form id= "uploadForm">  
      <p >指定文件名： <input type="text" name="filename" value= ""/></p >  
      <p >上传文件： <input type="file" name="file"/></p>  
	</form> 
 <button type="button" onclick="doUpload()" >uploadForm</button>
 
 <script type="text/javascript" src="jquery-1.11.3.min.js"></script>
<script type="text/javascript">
function doUpload() {  
    var formData = new FormData($( "#uploadForm" )[0]);  
    $.ajax({  
         url: 'PictureServerOrderIETwo' ,  
         type: 'POST',  
         data: formData,  
         async: false,  
         cache: false,  
         contentType: false,  
         processData: false,  
         success: function (returndata) {  
             alert(returndata);  
         },  
         error: function (returndata) {  
             alert(returndata);  
         }  
    });  
}  
</script>

</body>

</html>